package com.maxlen.coupon.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.maxlen.common.utils.PageUtils;
import com.maxlen.common.utils.R;
import com.maxlen.coupon.entity.CouponHistoryEntity;
import com.maxlen.coupon.entity.to.CouponLockTO;
import com.maxlen.coupon.entity.to.SkuInfoAndCartItemTO;
import org.springframework.util.MultiValueMap;

import java.util.List;
import java.util.Map;

/**
 * 优惠券领取历史记录
 *
 * @author MaxLen
 * @email MaxLen@gmail.com
 * @date 2022-10-27 10:43:47
 */
public interface CouponHistoryService extends IService<CouponHistoryEntity> {

    PageUtils queryPage(Map<String, Object> params);

    /**
     * 根据会员 id 获取会员所拥有的优惠券，并判断是否可用
     * @param token 用户 token
     * @return
     */
    R getCouponByMemberId(String token);

    R getOrderCouponPrice(SkuInfoAndCartItemTO skuInfoAndCartItemTO);

    void lockCoupon(CouponLockTO couponLockTO);

    void unlockCoupon(CouponLockTO couponLockTO);

    void unlockCoupon(String orderSn);

    R getCouponByCanUse();

    R getCouponByAlreadyUse();

    R getCouponByOutTime();

    void deleteBatchByCouponId(List<Long> asList);

    R receiveCoupon(String couponId);
}

